Virtual machines are complex software products that can be used to increase portability and stability of application software. Instead of compiling applications for a particular hardware platform, the applications are instead compiled for a virtual platform. A virtual machine tailored for a particular hardware platform then executes the applications compiled for the virtual machine. The virtual operations are, by tradition, referred to as “byte code”. Java is a language that is compiled to byte code, and the resulting applications are then executed within the virtual machine, or in the particular case of Java, a Java Virtual Machine (JVM). Examples of such virtual machines include the Hotspot product from Sun Microsystems, Inc., and the JRockit product from BEA Systems, Inc. The Java byte code supports several built-in types for variables, for example: integers, floating point numbers, characters, bytes, booleans, pointers to objects, arrays of these types, and objects containing these types. The Java language also includes a large library of useful objects and functions referred to as the Java Development Kit (JDK). The JDK is written in Java, and the compiled library needs to be present both at application compile time and at runtime.
Java is often used for interactive web applications, which generate web pages by concatenating static strings with strings, and other values from database searches. A particular problem with string concatenation is that, using traditional methods, even a simple string concatenation results in a long chain of calls, wherein each call is dependent on the previous call. These calls are handled using an append feature. However, implementations of buffer append classes, wherein the final length is unknown, starts with a small buffer size that is then doubled each time the buffer is exhausted. For each of these doubling steps a memory copy of the full buffer has to take place. This means that a lot of processor (CPU) time is spent just copying the same information over and over again, which impacts the system's performance, and any applications that are running thereon. As such, any improvement to the JVM that increases its performance would also provide significant performance improvements for web applications. This is the area the invention is designed to address.